Learning Objectives

After completing this lesson, you'll be able to:

Instructions

In this lesson, you will:

Resources

Exercise

Jennifer

Jennifer, a GIS Specialist, is rebuilding the city's community mapping dataset in GML. Two sources feed it: fire halls, which are entirely new, and city parks, which already existed in the old geodatabase as points rather than polygons. She wants the parks to keep the schema they had in that geodatabase rather than inherit the one that comes with the MapInfo data.

In this exercise, you will:

1) Generate the Workspace

The fire halls are the new data, so they start the workspace. Choosing Dynamic Schema is what lets the writer take its schema from somewhere other than the dataset being read.

Generating a dynamic workspace

2) Add the Parks Reader

The parks are the second source. Reading them as a single merged feature type keeps that side of the workspace schema-less, which matters because their schema is about to come from somewhere else entirely.

Adding a MapInfo TAB reader

New reader feature type attached

3) Add the Community Map as a Resource Reader

The fire halls have no history in the old geodatabase, but the parks do, and the brief is to reuse that schema. A resource reader makes a dataset's schema available to the workspace without reading any of its data.

File geodatabase reader as a resource

Geodatabase Resource Reader

4) Point the Writer at the Resource Schema

The writer will use whichever schema sources you tick. Selecting the community map for the parks, while leaving the MapInfo parks unticked, is what swaps one schema for the other.

Setting CommunityMap as the schema source

5) Run the Workspace

This run shows whether the parks really did pick up the geodatabase schema. It also exposes an attribute you didn't ask for.

Inspecting the output and noting missing attribute values

6) Remove OBJECTID

Attributes inherited from a resource reader can be dropped at the writer. OBJECTID has to be typed in by hand.

Removing OBJECTID

7) Add the LastUpdatedBy Attribute

A late request: every table in the output needs a LastUpdatedBy column. Adding it by hand alongside a dynamic definition shows the two can coexist.

Adding the LastUpdatedBy attribute

8) Re-Run the Workspace

The final check is that both edits took effect on both layers, not just the one that came from the geodatabase.

You have built a workspace whose writer takes its schema from a dataset it never reads, then trimmed and extended that schema at the writer. This is how you keep a new dataset consistent with an existing one without copying its structure into the workspace by hand.

 

Tips